/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */
typedef struct ListNode LST;
struct ListNode* removeElements(struct ListNode* head, int val) {
	LST* newhead , *per ;
	newhead = malloc(sizeof(LST));
	newhead->next = head;
	per = newhead;
	while(per->next)
	{
		if((per->next)->val == val)
		{
			per->next = per->next->next;
		}
		else
		{
			per = per->next;
		}
	}
	return newhead->next;
}
